@echo off
cls

set THIS_BAT_FILE=%0
set PATH_UTILITIES=%SOURCE_DIRECTORY%..\..\utilities
set PATH_SCRIPT=%PATH_UTILITIES%\mvs
set LOGGER=%PATH_UTILITIES%\cmdlog.exe

if not exist %LOGGER% set STDOUT_REDIRECTED=yes

if not "%STDOUT_REDIRECTED%" == "yes" (
    set STDOUT_REDIRECTED=yes
    cmd.exe /c %THIS_BAT_FILE% %* 2>&1 | %LOGGER% 1build.log
    exit/b
) 

echo -------------------------------------------------^> BEGIN WORK
set SOURCE_DIRECTORY=%~dp0
set GENERATOR=Visual Studio 11
set TOOLSET=v120_CTP_Nov2012
set MODE=Release
set MODE=RelWithDebInfo
set MODE=Debug
set ADDRESSMODEL=64
set ADDRESSMODEL=32
set ACTION=stop
set ACTION=build
set ACTION=launch

set UNITTESTMODE=ON
set UNITTESTMODE=OFF

if "%ACTION%" == "launch" set UNITTESTMODE=ON
if "%ACTION%" == "build"  set UNITTESTMODE=OFF

rem ----------------------------------------------------------------

call %PATH_SCRIPT%\prepare.bat "%SOURCE_DIRECTORY%" "%GENERATOR%" "%TOOLSET%" "%MODE%" "%ADDRESSMODEL%" "%ACTION%"
call %PATH_SCRIPT%\clear-cache.bat
call %PATH_SCRIPT%\make-mvs.bat
call %PATH_SCRIPT%\action.bat   
rem call %PATH_SCRIPT%\install_library.bat %SOURCE_DIRECTORY%..\..\external
rem call %PATH_SCRIPT%\clear.bat
echo -------------------------------------------------^> END WORK

exit /b


